<!DOCTYPE html>
<html lang="en">
<head>
    [#include "/customer/include/static.htm"]
    <link href="${path}/resources/css/user.css" rel="stylesheet" type="text/css" />

    <link href="${path}/resources/plug/layui/css/layui.css" rel="stylesheet" type="text/css"/>
    <script src="${path}/resources/plug/layui/layui.js" type="text/javascript"></script>
</head>
<body>
[#include "/customer/include/header.ftl"]

<div class="member">
    <!--左边-->
[#include "/customer/include/member_left_menu.ftl"]

<div class="memberRight">
    <div class="member_tab">
        <div class="member_tab">
            <a href="/member/account/log">资金明细</a>
            <a   href="/member/account/edit">银行账户</a>
            <a  class="on"  href="/member/account/go_recharge_offline">线下充值</a>
            <a href="/member/account/go_recharge_online">线上充值</a>
            <a href="/member/account/recharges">充值记录</a>
            <a href="/member/account/gocash">用户提现</a>
            <a href="/member/account/withdrawals">提现记录</a>

        </div>
    </div>
    <div class="member_tab_info">
        <!--账户充值 start-->
        <form class="layui-form">
            <table class="layui-table ">
                <tbody>

                <tr>
                    <td>充值类型：</td>
                    <td class="form-inline fund_audit">
                        <div class="offline" style="">
                            <select  name="payMethod" lay-verify="required" class="layui-input">
                            [#list payments as paymentOne]
                                [#if paymentOne.style==0]
                                    <option value='${paymentOne.id}'>${paymentOne.name}${paymentOne.description }</option>
                                [/#if]
                            [/#list]
                            </select>
                    </td>
                </tr>
                <tr class="offline" style="">
                    <td>银行流水号：</td>
                    <td>
                        <input class="layui-input" lay-verify="required" type="text" name="tradeNo" maxlength="20">
                    </td>
                </tr>
                <tr>
                    <td>充值金额：</td>
                    <td>
                        <input class="layui-input" placeholder="￥" lay-verify="required" type="text" name="money" id="money" maxlength="20">
                    </td>
                </tr>
                <tr>
                    <td>验证码：</td>
                    <td>
                        <div class="layui-input-inline"  style="width: 210px">
                        <input style="margin-left:5px;width: 100px;" lay-verify="required" class="layui-input" name="captcha" type="text" maxlength="4">
</div>

                        <a href="javascript:void(0);" onclick="$('#randImage').click()">
                            <img name="randImage" id="randImage" src="${path}/common/random" onclick="this.src = '/common/random?' + Math.random();" width="80" height="30">
                        </a>

                    </td>
                </tr>
                <tr>
                    <td></td>
                    <td>
                        <button lay-submit lay-filter="MainForm" class="layui-btn" type="submit" style="background-color: #F3485A;">
                            确认提交
                        </button>
                    </td>
                </tr>
                </tbody>
            </table>
            <!--账户充值 end--></form></div>
</div>
</div>
[#include "/customer/include/footer.ftl"]

<script type="text/javascript">
    layui.use('form', function(){
        var form = layui.form(), $=layui.jquery, layer = layui.layer;
        form.on('submit(MainForm)', function(data){
            layer.confirm("您确认线下充值吗？",function() {
                var index = layer.load();
                ajax({
                    url: "${path}/member/account/recharge_offline",
                    data: data.field,
                    success: function (result) {
                        if (result.type == "success") {
                            layer.msg(result.content, function () {
                                window.location.href = "${path}/member/account/recharges";
                            });
                        } else {
                            layer.msg(result.content, {icon: 2});
                        }
                        layui.layer.close(index);
                    },
                    complete: function () {
                        layui.layer.close(index);
                    }
                });
            });
            return false;
        });
    });
</script>
</body>
</html>